package com.dimples.dd.system.mapper;

import com.dimples.dd.common.pojo.PageResult;
import com.dimples.dd.mybatis.core.query.LambdaQueryWrapperX;
import com.dimples.dd.system.model.entity.SystemFileDO;
import com.dimples.dd.system.model.query.FilePageQuery;
import org.apache.ibatis.annotations.Mapper;

@Mapper
public interface SystemFileMapper extends com.dimples.dd.mybatis.core.mapper.BaseMapperX<SystemFileDO> {
    default PageResult<SystemFileDO> selectPage(FilePageQuery reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<SystemFileDO>()
                .likeIfPresent(SystemFileDO::getPath, reqVO.getPath())
                .likeIfPresent(SystemFileDO::getType, reqVO.getType())
                .betweenIfPresent(SystemFileDO::getCreateTime, reqVO.getCreateTime())
                .orderByDesc(SystemFileDO::getId));
    }
}